Skip to content

Conversation

@fintelia
Copy link
Contributor

@fintelia fintelia commented Apr 2, 2024

This adds benchmarks of other crate methods that previously weren't benchmarked.

b.iter(|| {
for _ in 0..NITER {
bb(BigEndian::$read(&buf, $bytes));
bb(BigEndian::$read(&buf, bb($bytes)));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure whether the $bytes input should be wrapped in black_box, but I noticed it has a huge impact on performance, so I figured I'd mention it

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm I don't think so. But I'm honestly not sure. I'd have to see a minimal reproducible example and compare codegen I think.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I would defer to the status quo for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants